<div class="container-fluid" style="padding: 20px 10px 0px 10px">
<style>
    .setimg {
        margin: -2px 5px 0 0
    }
</style>
<div class="row-fluid">
    <a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>
    <div class="well">
        <div class="btn-toolbar">
            <button class="btn btn-primary ifrm" data-url="/case/addCases" data-width="750" data-height="360"
                    data-title="添加案例" data-params="" style="float:right;padding:3px 6px">添加案例
            </button>
            <form>
                <label style="display: inline;">案例名称：</label><input class="input input-medium" type="text"
                                                                    name="case_title" value="<?=I('get.case_title')?>"/>
                <input type="hidden" value="<?=I('get.res')?>" name="res"/>
                <input type="hidden" value="<?=I('get.hospt_id')?>" name="hospt_id"/>
                <button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
            </form>
        </div>
        <hr>
        <table class="table">
            <tr>
                <th style="text-align:center">序号</th>
                <th style="text-align:center">案例名称</th>
                <th style="text-align:center">案例分类</th>
                <th style="text-align:center">案例所属</th>
                <th style="text-align:center">添加时间</th>
                <th style="text-align:center">操作</th>
            </tr>
                <?php if($data){ foreach($data AS $key=>$vals){ ?>
                <tr>
                    <td style="text-align:center;vertical-align:middle"><?=$vals['case_id']?></td>
                    <td style="text-align:center;vertical-align:middle"><?=$vals['case_title']?></td>
                    <td style="text-align:center;"><?=$vals['case_type']==1?'医生案例':'机构案例'?></td>
                    <?php if($vals['case_type'] == 1){
                            $doctor = M('DoctorEntity')->where('doctor_id='.$vals['dataval'])->find();
                        }elseif($vals['case_type'] == 2){
                            $hospt = M('HosptEntity')->where('hospt_id='.$vals['dataval'])->find();
                        }
                    ?>
                    <td style="text-align:center;"><?=$vals['case_type']==1?$doctor['doctor_name']:$hospt['hospt_title']?></td>
                    <td style="text-align:center;vertical-align:middle"><?=date("Y-m-d H:i",$vals['add_at'])?></td>
                    <td style="text-align:center;vertical-align:middle">
                        <a class="ifrm" href="javascript:void(0)" data-url="/case/addCases"
                           data-width="750" data-height="360" data-title="修改案例"
                           data-params="case_id/<?=$vals['case_id']?>"><i class="icon-pencil"></i></a>&nbsp;&nbsp;&nbsp;
                        <a href="/case/delCases?case_id=<?=$vals['case_id']?>"
                           class="deattv" role="button" data-toggle="modal"><i class="icon-remove"></i></a>
                    </td>
                </tr>
                <?php }}else{?>
            <tr>
                <td style="text-align:center;vertical-align:middle" colspan=7>暂无数据</td>
            </tr>
            <?php }?>
        </table>
        <span style="float:right;margin-top:-25px"><?=$page?></span>
    </div>
</div>
    </div>
<script>
    $(function () {
        $('.deattv').click(function () {
            if (!window.confirm('确认要删除该作品图么 ?')) {
                return false;
            }
            window.location = $(this).attr('href');
        });
    })
</script>